#include<iostream>
using namespace std;
class Solution {
public:
    int myAtoi(string str) {
        int flag = 0;
        int charte = 1;
        int count = 0;
        while ((size_t)flag < str.size())
        {

            if (str[flag] == ' ' || str[flag] == '_' || str[flag] == '-')
            {
                if (str[flag] == '-')
                {
                    charte = -1;
                }
                ++flag;
            }
            else
            {
                break;
            }
        }
        int i = flag;
        while (str[flag] <= '9' && str[flag] >= '0')
        {
  
            if (i == 10)
            {
                return SIZE_MAX;
            }
            int cut = str[flag] - '0';
            count = count * 10;
            count += cut;
            ++flag;
            ++i;
            if (flag == str.size())
            {
                break;
            }
        }
            return charte * count;

    }
};
int main()
{
    string d1{ "-91283472332" };
    Solution d3;
    d3.myAtoi(d1);
	return 0;
}